/*
 * @Author: HeAo
 * @Date: 2021-11-01 14:30:55
 * @LastEditTime: 2021-11-01 15:21:09
 * @LastEditors: HeAo
 * @Description:
 * @FilePath: \web2103-2105\web2105\4-1-Nodejs\day02\1-questions.js
 * 别乱动！
 */
let fs = require('fs')
let axios = require('axios')


console.log('begin');

// I/O操作
axios.get('http://121.199.29.84:8002/index/findAllCategory').then(res => {
  console.log(res.data.status);
})

fs.readFile('./a.txt', (err, buffer) => {
  console.log(buffer);
})

setImmediate(() => {
  console.log('setImmediate');
})

setTimeout(() => {
  console.log('setTimeout');
}, 1000)

// 微任务


Promise.resolve().then(() => {
  console.log('承诺成功');
})
process.nextTick(() => {
  console.log('下一次滴答');
})

  ; (function () {
    console.log('立即执行函数');
  })()

console.log('end');

